// pages/video-content/index.js
import { getMVDetail, getMVUrl, getRelatedVideo } from '../../service/api_video'

Page({
	/**
	 * 页面的初始数据
	 */
	data: {
		MVDetail: {},
		MVUrlInfo: {},
		relatedVideo: []
	},

	/**
	 * 生命周期函数--监听页面加载
	 */
	onLoad(options) {
		const id = options.id

		this.getContentData(id)
	},

	getContentData(id) {
		getMVDetail(id).then(res => {
			this.setData({ MVDetail: res.data })
		})
		getMVUrl(id).then(res => {
			this.setData({ MVUrlInfo: res.data })
		})
		getRelatedVideo(id).then(res => {
			this.setData({ relatedVideo: res.data })
		})
	}
})
